<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title><s:text name="hotKeyword.list.title"/></title>
	<%@ include file="/common/meta.jsp"%>
	<%@ include file="/common/common.jsp"%>
</head>
<body>
<div id="wrapper">
	<div id="main_box">
	<div class="curmb"><s:text name="your.site.position"/>:<a href="${ctx}/main.action"><s:text name="homepage"/></a><span>></span><s:text name="hotKeyword.title"/></div>
	<div class="listtit" id="listtit"><p><span><strong><s:text name="hotKeyword.list.title"/></strong></span></p></div>
	<s:form action="hotkeyword-list" id="search_form">
	<div class="searchbox">
		<table class="searchTable">
			<tbody id="searchTable">
				<tr>
					<td class="text"><label for="search" class="labelKeywords"><s:text name="key.words"/>:</label></td>
					<td class="input"><s:textfield name="hotKeyword.hotKeywordName" id="hotKeywordName" cssClass="txtsearch_long"  maxlength="30" /></td>
					<td class="text"><label for="selectClass">选择类别: </label></td>
					<td class="input">
						<s:select list="hotKeywordTypes" cssClass="selectClass" headerKey="" headerValue="请选择"  listKey="key" listValue="value" name="hotKeyword.hotType"></s:select>
					</td>
					<td><input type="button" value="<s:text name="query"/>" class="btnsearch" id="search_btn"/></td>
				</tr>
			</tbody>
		</table>
		<div class="clear"></div>
	</div>
	<div class="listoperate">
		<span class="cssa">
			<s:if test="%{authLicence('1_1_8')}">
				<input id="top_new_btn" type="button" value="<s:text name="new"/>" class="btnadd"/>
			</s:if>
			<s:else>
				<input id="top_new_btn" type="button" value="<s:text name="new"/>" class="btnadd" disabled="disabled"/>
			</s:else>
		</span>
		<span>
			<input type="button" value="<s:text name="anti-selection"/>" class="btnlist2" id="top_anti_btn"/>
			<s:if test="%{authLicence('1_1_8')}">
				<input type="button" value="<s:text name="delete"/>" class="btnlist2" id="top_del_btn"/>
			</s:if>
			<s:else>
				<input type="button" value="<s:text name="delete"/>" class="btnlist2" id="top_del_btn" disabled="disabled"/>
			</s:else>
		</span>
	</div>
	<div class="listbox" id="listbox">
		<table class="listgrid" id="listbox">
			<tbody>
				<tr>
					<th><input type="checkbox" name="all" id="all_check"/></th>
					<th><s:text name="hotKeyword.searchNum"/></th>
					<%-- <th><s:text name="hotKeyword.isGenerate"/></th> --%>
					<th>关键字</th>
					<th><s:text name="hotKeyword.frontFilename"/></th>
					<th><s:text name="hotKeyword.hotType"/></th>

					<th><s:text name="operate"/></th>
				</tr>
				<s:iterator value="page.result">
					<tr>
					<td><input type="checkbox" name="key" value="<s:property value="hotKeywordId"/>"/></td>
					<td><s:property value="searchNum"/></td>
					<td><s:property value="hotKeywordName"/></td>
					<%-- <td><s:property value="searchNum"/>&nbsp;</td>
					<td><s:property value="isGenerate"/>&nbsp;</td> --%>
					<td><s:property value="frontFilename"/>&nbsp;</td>
					<td><s:property value="%{transForm(hotType)}"/>&nbsp;</td>

						<td>
							<s:if test="%{authLicence('1_1_8')}">
								<a href="#this" onclick="goEdit('hotKeyword.hotKeywordId','<s:property value="hotKeywordId"/>')"><s:text name="edit"/></a><tt>|</tt>
							    <a href="#this" onclick="goDel('<s:property value="hotKeywordId"/>')"><s:text name="delete"/></a>
							</s:if>
							<s:else>
								<s:text name="edit"/><tt>|</tt>
								<s:text name="delete"/>
							</s:else>
						</td>
					</tr>
				</s:iterator>
			</tbody>
		</table>
	</div>
	<div class="listoperateb ">
		<div class="pager fr"><z:page numberNav="true" selectPageSize="true" input="true" id="ctrl"/></div>
		<span>
			<input type="button" value="<s:text name="anti-selection"/>" class="btnlist2" id="bottom_anti_btn"/>
			<s:if test="%{authLicence('1_1_8')}">
				<input type="button" value="<s:text name="delete"/>" class="btnlist2" id="bottom_del_btn"/>
			</s:if>
			<s:else>
				<input type="button" value="<s:text name="delete"/>" class="btnlist2" id="bottom_del_btn" disabled="disabled"/>
			</s:else>
		</span>
	</div>
	</s:form>
	</div>
</div>

</body>
</html>
<script type="text/javascript" defer="defer">
	actionName = "hotkeyword";	
	confirmStr = "<s:text name="delete.confirm"/>";
	chiocenothing = "<s:text name="chiocenothing"/>";
	$(function(){
 		$("#top_new_btn").click(goNew);
 		$("#top_anti_btn").click(antiSelect);
 		$("#top_del_btn").click(goBatchDel);
 		$("#bottom_del_btn").click(goBatchDel);
 		$("#bottom_anti_btn").click(antiSelect);
		$("#search_btn").click(search);
		$("#all_check").click(selAll);
		$("#extend").click(extend);
	});
	var g = function(D) {
		if ( D.indexOf(" ") == -1){
			return ( D.substring(0,1) === "#") ? document.getElementById(D.substring(1,D.length)) : document.getElementsByTagName(D);
		}
		else {
			var ary = D.split(" ");
			return g(ary[0]).getElementsByTagName(ary[1]);
		}
	};
	function inputvalue(){
		var d = g("#listbox input"), i = 0, j = d.length, str = "";
	    for ( ; i < j ; i ++ ) {
				str += (d[i].type == "checkbox" && d[i].id != "totalCheck" && d[i].checked == true ) ? d[i].value + "@" : "";
		};	
		return (str.slice(0,-1));
	};
	function goBatchDel(){
		var ids = inputvalue();
		if(!ids){
			return;
		}
		if(confirm(confirmStr)){
			document.location.href = "${ctx}/search/hotkeyword-delete.action?ids="+ids;
		}
	}
$(function(){
	if ($.browser.msie && ($.browser.version == "6.0") && !$.support.style) {
		$('#main_box').width($('#main_box').width()-25);
		}
	
	
});
	</script>